1. Field of the Invention
This invention relates to the field of color editing and display systems.
Portions of the disclosure of this patent document contain material that is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure as it appears in the Patent and Trademark Office file or records, but otherwise reserves all copyright rights whatsoever.
2. Background
Computer graphics and imaging systems often use color displays as output devices or as a means to view work in progress before generating a color print output. In either case, the color display should provide accurate representation of desired colors. Often, color images are "scanned" into a computer graphics system for manipulation or editing. In other cases, color images are generated or rendered in a computer graphics systems for display.
For display purposes, hardware constraints may dictate how colors are represented in the display memory. For instance, a three phosphor display system may store color data as a combination of three phosphor intensity values, such as in a RGB display system. However, for color image editing and manipulation, color representation should be more intuitive to the graphic artist, allowing manipulation of tints, shades and tones. Therefore, in computer graphics and imaging systems, color representation is subject to constraints imposed by the display hardware and by the graphic artist.
RGB color is a commonly used color format for graphic display systems. RGB color is based on a "color model" system. A color model allows convenient specification of colors within a color range, such as the RGB (red, green, blue) primary colors. A color model is a specification of a three-dimensional color coordinate system and a three-dimensional subspace or "color space" in the coordinate system within which each displayable color is represented by a point in space. Typically, computer and graphic display systems are three phosphor systems with a red, green and blue phosphor at each pixel location. The intensities of the red, green and blue phosphors are varied so that the combination of the three primary colors results in a desired output color.
The RGB color model uses a Cartesian coordinate system. The subspace of interest in this coordinate system is known as the "RGB color cube" and is illustrated in FIG. 1. Each corner of the cube represents a color that is theoretically one-hundred percent pure--that is, the color at that location contains only the color specified, and contains no amount of other colors. In the RGB color cube, the corners are defined to be black, white, red, green, blue, magenta, cyan, and yellow. Red, green and blue are the primary colors, black is the absence of color, white is the combination of all colors, and cyan, magenta and yellow are the complements of red, green and blue.
Still referring to FIG. 1, the origin of the coordinate system corresponds to the black corner of the color cube. The cube is a unit cube so that the distance between the origin and adjacent corners is 1. The red corner is thus at location, (1,0,0). The axis between the origin (black) and the red corner is referred to as the red axis 110.
The green corner is at location (0,1,0) and the axis 120 between the black origin and the green corner is referred to as the green axis. The blue corner is at location (0,0,1) and the blue axis 130 is the axis between the blue corner and the origin.
Cyan is at corner (0,1,1), magenta is at corner (1,0,1) and yellow is at corner (1,1,0). The corner opposite the origin on the cube's diagonal at location (1,1,1) is the white corner.
A color is defined in the color cube by a vector having red, green and blue components. For example, vector 180 is the resultant of vectors 180R, (along the red axis), vector 180G (along the green axis) and vector 180B (along the blue axis). The end point of vector 180 can be described mathematically by 0.25 R+0.50 G+0.75 B. The end of this vector defines a point in color space represented mathematically by sum of its red, green and blue components.
An example of a system for displaying RGB color is illustrated in FIG. 2. A refresh buffer 140, also known as a video RAM, or VRAM, is used to store color information for each pixel on a video display, such as CRT display 160. A DRAM can also be used as buffer 140. The VRAM 140 contains one memory location for each pixel location on the display 160. For example, pixel 190 at screen location X.sub.0 Y.sub.0 corresponds to memory location 150 in the VRAM 140. The number of bits stored at each memory location for each display pixel varies depending on the amount of color resolution required. For example, for word processing applications or display of text, two intensity values are acceptable so that only a single bit need be stored at each memory location (since the screen pixel is either "on" or "off"). For color images, however, a plurality of intensities must be definable. For certain high end color graphics applications, it has been found that 24 bits per pixel produces acceptable images.
Consider, for example, that in the system of FIG. 2, 24 bits are stored for each display pixel. At memory location 150, there are then 8 bits each for the red, green and blue components of the display pixel. The eight most significant bits of the VRAM memory location could be used to represent the red value, the next 8 bits represent the green value and the 8 least significant bits represent the blue value. Thus, 256 shades each of red, green and blue can be defined in a 24 bit per pixel system. When displaying the pixel at X0, Y0, the bit values at memory location 150 are provided to video driver 170. The bits corresponding to the R component are provided to the R driver, the bits representing the green component are provided to the G driver, and the bits representing the blue component are provided to the blue driver. These drivers activate the red, green and blue phosphors at the pixel location 190. The bit values for each color, red, green and blue, determine the intensity of that color in the display pixel. By varying the intensities of the red, green and blue components, different colors may be produced at that pixel location.
Many of the colors that can be defined in the color cube cannot actually be displayed or have differences perceived because of limitations on the responsiveness of the red, green and blue phosphors. One prior art attempt to provide a solution to this problem is to define a color space within the color cube that is optimized for human perception. One such color space is known as the YIQ color space which is used in the commercial color TV broadcasting system known as NTSC (National Television Standards Committee). The YIQ color space is a recoding of the RGB color space for transmission efficiency and also to provide compatibility with black and white television. The YIQ model is a 3D Cartesian coordinate system mapped into the RGB color cube. Transmission efficiency is achieved by reducing bandwidth in I and Q. The RGB to YIQ conversion that performs the mapping is defined by the following matrix equation: ##EQU1##
The inverse of the matrix is used for the reverse conversion. The Y axis of the YIQ color model represents the luminance of the display pixel, and matches the luminosity response curve for the human eye. In a black and white receiver, only the Y value is used. In a color receiver, all three axes are used to provide display information.
In operation, an image may be recorded with a color camera, which is an RGB system, and converted to YIQ for transmission. At the receiver, the YIQ information is then retransformed into RGB information to drive the color display.
Whereas the RGB and YIQ color spaces are defined to meet hardware constraints, a more user-intuitive model is desired that reflects a graphic artist's feel for tint, shade, and tone. One such color space definition is the HSV color space, which is described along with YIQ color space on pages 613-616 of "Fundamentals of Interactive Computer Graphics," by J. D. Foley and A. Van Dam, published by Addison-Wesley Publishing Company in 1984.
The HSV color space has three parameters (or components): hue, saturation, and value. The HSV color space can be represented by hexagonal cone, as illustrated in FIG. 3, wherein the central axis is the V (value) axis. The apex of the cone is at V=0, and represents black, or (0,0,0) on the RGB cube. The base of the cone is at V=1. The cone may be separated into hexagonal planes (or hexagons) of constant V, e.g., hexagon 300 of FIG. 3. The value for V is calculated from the RGB components by simply taking the maximum value of the RGB components.
The saturation parameter S is a ratio, ranging from S=0 at the center of the hexagons (i.e., along the V axis), to S=1 at the edges. The point (S=0, V=1) represents white, and corresponds to (1,1,1) on the RGB cube. Intermediate values of V at S=0 correspond to grays. The value for S is calculated by subtracting the minimum RGB value from the maximum RGB value, and then dividing by the maximum RGB value (or V value): EQU S=max(R,G,B)-min(R,G,B)!/max(R,G,B) 2!
The hue parameter H determines the pigment content of the color. Hue is measured as the angular rotation about the V axis. Each apex of the hexagons represents either a primary color or a complement of one of the primary colors. To maintain the unitary range of the color model, a full rotation of 360.degree. is equal to one, and a rotation of 180.degree. is equal to one-half. The locations of the primary and complementary colors around the hue arc are red at H=0 (1), yellow at H=1/6, green at H=2/6, cyan at H=3/6, blue at H=4/6 and magenta at H=5/6. Pure pigments are located at the appropriate H value, where V=S=1. The hue value is determined from the RGB components based on which component is the greatest and which is the least.
FIG. 5 shows a hue line from H=0 to H=1, delineating the maximum and minimum RGB contributors over the hue range. The range is divided into regions I-VI for calculation of the hue value from the RGB components. These hue regions are bounded on either side by hue values representing the primary and complementary colors. These hue values also represent RGB values wherein two of the three RGB components are equal. (No hue value is indicated for R=G=B, because the associated saturation value is zero, indicating a color along the V-axis where hue is irrelevant.) The minimum and maximum components for the respective regions are outlined in the following table:
TABLE 1 ______________________________________ HUE CHARACTERISTICS REGION HUE RANGE MINIMUM, MAXIMUM RGB ______________________________________ I 0-1/6 BLUE, RED II 1/6-2/6 BLUE, GREEN III 2/6-3/6 RED, GREEN IV 3/6-4/6 RED, BLUE V 4/6-5/6 GREEN, BLUE VI 5/6-6/6 GREEN, RED ______________________________________
One method for calculating hue is to determine the hue region containing the color based on the minimum and maximum RGB component values, and then to perform a calculation for the appropriate regional case. At the point where two of the three RGB components are equal, both equations for the adjoining regions will provide the same hue value. One possible set of calculations is given below: EQU Region I: H=1-(R-G)/(R-B)!(1/6) 3! EQU Region II: H=1+(G-R)/(G-B)!(1/6) 4! EQU Region III: H=3-(G-B)/(G-R)!(1/6) 5! EQU Region IV: H=3+(B-G)/(B-R)!(1/6) 6! EQU Region V: H=5-(B-R)/(B-G)!(1/6) 7! EQU Region VI: H=5+(R-B)/(R-G)!(1/6) 8!
Under the HSV model, for constant value (V) at constant saturation, the RGB values over the hue range are simply defined. Each R, G and B value is equal to V for the one-third of the hue range centered on its pure pigment hue value (e.g., H=0 for R), equal to the minimum value for the one-third of the hue range centered around the pure complement pigment hue value, and transitioning linearly between the minimum value and V in the remaining portions of the hue range.
FIGS. 4A-4C are graphs of the individual RGB component values versus hue at saturation S=1 and value V=1. As shown in FIG. 4A, the red component (R) of the RGB value has a constant value of R=1 from H=0 to H=1/6, and from H=5/6 to H=1. At H=1/6, the red component ramps down to R=0 at H=2/6. R remains constant at R=0 from H=2/6 to H=4/6, then ramps up to R=1 at H=5/6.
In FIG. 4B, the green component (G) of the RGB value is G=0 at H=0, but ramps up to G=1 at H=1/6. From H=1/6 to H=3/6, the green component is constant at G=1. Between H=3/6 and H=4/6, the green component ramps down from G=1 to G=0, and from H=4/6 to H=1, the green component remains constant at G=0.
In FIG. 4C, the blue component (B) of the RGB value is B=0 from H=0 to H=2/6, then ramps up to B=1 at H=3/6. The blue component remains constant at B=1 from H=3/6 to H=5/6, then ramps down to B=0 at H=1.
With the HSV color model, color description and manipulation are user intuitive. For instance, adding black pigment corresponds to decreasing value without changing saturation. Adding white pigment corresponds to decreasing saturation without changing value. Tones can be created by decreasing both saturation and value. Selecting hue corresponds to selecting the pure pigment from which to start.
Unfortunately, the prior art intuitive color models, such as HSV, do not account for the luminosity response curve of the human eye. The human eye is far more responsive to light at wavelengths corresponding to green than to light at wavelengths corresponding to red or blue. Because of this, colors with equal value (V) appear more luminous if they are in the green hue region, than if they are in the blue or red region. Value is easily understood from a mathematical standpoint, but far from intuitive for the graphic artist. For instance, on the hue wheel, certain regions of the wheel will appear brighter, despite having a constant value (V). This is undesired from a graphic artist's standpoint.
In general, luminance can be calculated from RGB values as follows: EQU Y=k.sub.R (R)+k.sub.G (G)+k.sub.B (B) 9!
where k.sub.R, k.sub.G and k.sub.B are constants determined by the specific intensities generated by the luminance response of the human eye (called the luminous efficiency function) and the characteristics of a given display system.
One definition of k is that used for commercial National Television Standards Committee (NTSC) broadcast video. Here, luminance is defined by the YIQ color space and was based on the display devices currently in use when the standard was written. The coefficient values can be taken from the RGB to YIQ color space transformation: k.sub.(RGB) =(0.298939 0.586625 0.114436). These values are commonly rounded to k.sub.(RGB) =(0.299 0.587 0.114).
The International Telecommunications Union (ITU) Recommendation BT. 709, "Basic Parameter Values for the HDTV (High Definition Standard) Standard for the Studio and for International Program Exchange" defines luminance with k.sub.(RGB) =(0.212671 0.715160 0.072169). In any case, the primary driving force in determining the coefficients is the non-uniform response of the human eye to the light in the red, green and blue parts of the spectrum. As a result, the green coefficient, k.sub.G, will always be the largest, k.sub.R will be intermediate, and k.sub.B will be the smallest.
Applying the NTSC luminosity equation to the RGB values of FIGS. 4A-4C for S=V=1 illustrates the disparity between value (V) and luminance (Y) over the hue range. Table 2 below provides approximate luminance values for the primary and complementary pigment points around the hue wheel.
TABLE 2 ______________________________________ HSV LUMINANCE VALUES HUE (H) LUMINANCE (Y) (@ S=V=1) ______________________________________ 0 k.sub.R 1/6 k.sub.R + k.sub.G 2/6 k.sub.G 3/6 k.sub.G + k.sub.B 4/6 k.sub.B 5/6 k.sub.B + k.sub.R ______________________________________
The resulting NTSC luminance versus hue response is shown in FIG. 6. Luminosity is at a maximum around H=1/6 (yellow), and at a minimum around H=4/6 (blue), with luminosity at the maximum being roughly eight times that at the minimum. Further, the waveform is nonlinear, providing difficulty for the graphic artist in predicting luminance behavior.
Similarly, luminance is also a function of saturation in HSV space. For instance, at H=0 and V=1, the luminance value at S=0 (R=G=B=1) is k.sub.R +k.sub.G +k.sub.B =1.0, and the luminance value at S=1 (R=1, G=B=0) is k.sub.R. The relationship between saturation (S) and luminance (Y) at H=0 and V=1 can be expressed as: EQU Y=1-(1-k.sub.R)S 10!
Therefore, for constant hue and value, as saturation is increased, the luminance decreases and the color appears visibly darker. Conversely, as the saturation decreases, the luminance increases and the color appears visibly brighter.
Thus, though HSV provides for independent manipulation of hue, saturation and value, the eye of the graphic artist registers an unwanted and non-intuitive dependence between hue and luminance, and saturation and luminance.